package com.wzcl.app.dao.repository;

import com.wzcl.app.dao.model.CourseComment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CourseCommentRepository extends JpaRepository<CourseComment,Integer>, JpaSpecificationExecutor<CourseComment> {
    List<CourseComment> findAllByParentId(Integer parentId);

    //根据教师id查询课程id
    @Query(value = "select cc.courseId from CourseComment cc where cc.userId = ?1")
    List<Integer> findCourseIdByUserId(Integer userId);
}
